/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package DataAccess;

import Entity.Account;
import Servlet.PMF;
import com.google.appengine.api.datastore.Key;
import java.util.List;
import javax.jdo.PersistenceManager;
import javax.jdo.Query;

/**
 *
 * @author phuc
 */
public class UserAccess {
    PersistenceManager pm;
    public UserAccess(){
        pm = PMF.get().getPersistenceManager();
    }
    public Account getUserByID(Long ID){
        Account acc = new Account();
       
        Query q = pm.newQuery(Account.class,"id == uid");
        q.declareParameters("Long uid");
        List<Account> results = (List<Account>)q.execute(ID);
        acc = results.get(0);
        if (results.size() > 0)
        {
            return acc;
        }
        return null;
    }
}
